/**
 * 
 */
package com.tvshows.front.listener.command;

import com.tvshows.front.factory.TypeUI;
import com.tvshows.front.factory.ViewFactory;
import com.tvshows.front.listener.command.interfaces.FavoriteCommand;
import com.tvshows.front.ui.FrontUI;
import com.tvshows.front.ui.dialog.ActionsUI;
import com.tvshows.interactions.ObserverBdd;

/**
 * @author tMidy
 * <p>
 * Executes the favorite modification treatment
 * </p>
 */
public class ModifyFavoriteCommand
    extends FavoriteCommand
{

    /**
     * The {@link FrontUI}
     */
    private final FrontUI composite;

    /**
     * Constructeur
     */
    public ModifyFavoriteCommand( FrontUI composite )
    {
        this.composite = composite;
    }

    /**
     * @see com.tvshows.front.listener.command.interfaces.FavoriteCommand#executeCommand()
     */
    @Override
    public void executeCommand()
    {
        // creates the actions view
        ActionsUI actionsView = (ActionsUI) ViewFactory.getUI( TypeUI.ACTIONS_VIEW );
        actionsView.setModify( true );
        actionsView.openShell( composite );
        ObserverBdd.getObserverBdd().activeDeleteOnFavorite();
    }

}
